/**
 * 
 */
package br.com.dp.dto.excecao;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import br.com.dp.dto.dominio.generico.DominioEnum;


/**
 * @author emmanuel
 *
 */
@AllArgsConstructor
public enum ErrorCode implements DominioEnum<Long> {
	
	ERRO_CONVERSAO(1l,"Erro de conversão.");
	
	@Getter
	@Setter
	private Long chave;
	
	@Getter
	@Setter
	private String mensagem;

	@Override
	public ErrorCode getEnumByChave(Long chave) {
		for (ErrorCode errorCode : values())
			if(errorCode.getChave() == chave)
				return errorCode;
		return null;
	}
}
